const _ = require('lodash');
const config = {
  // days: [], // 选择显示的天数，如果没有days，总体显示，[]显示所有的天数，[,[],[]]显示vue所有的天数，[[1,2],[],[]]只显示vue1/2两天
  // day: 10, // 如果设置了天数，就显示这几天的课件
  projectName: 'qf',
  title: '千锋前端开发教程',
  favicon: 'img/favicon.ico',
  logo: 'img/logo.png',
  colors: {
    primaryColor: '#FF8C00',
    secondaryColor: '#F0E68C',
    activeColor: '#FF4040',
    tintColor: '#005068'
  },
  highlight: { // 代码的风格 [可空]
    theme: 'atom-one-dark',
  },
  documentPath: 'docs', //默认为docs
  styles: ['css/common.css'],
  scripts: [],
  footer: 'lib/Footer.js', //设置footer
  homePage: {
    name: '千锋前端开发教程',
    path: 'index.md'
  },
  sideNavCollapsible: true, // 侧边栏是否可以折叠
  menus: [
    {
      visible: true,
      name: 'vue',
      groups: [
        {
          name: '作业环境搭建',
          pages: [
            { name: 'git的安装', path: 'share/作业环境搭建/git的安装.md' },
            { name: '提交作业', path: 'share/作业环境搭建/提交作业.md' },
            { name: '查看老师的批改', path: 'share/作业环境搭建/查看老师的批改.md' },
          ]
        },
        {
          name: 'vue初探',
          pages: [
            { name: '前端框架和Vue简介', path: 'vue/vue初探/前端框架和Vue简介.md' },
          ]
        },
        {
          name: 'vue入门',
          pages: [
            { name: '你眼中的helloworld', path: 'vue/vue入门/helloworld.md' },
            { name: '原生helloword', path: 'vue/vue入门/origin.md' },
            { name: 'vue3的helloword', path: 'vue/vue入门/vue3.md' },
            { name: 'vue2的helloword', path: 'vue/vue入门/vue2.md' },
            { name: '原生的学生列表', path: 'vue/vue入门/原生的学生列表.md' },
            { name: 'vue版本的学生列表', path: 'vue/vue入门/vue版本的学生列表.md' },
            { name: '比较图', path: 'vue/vue入门/diff.png' },
            { name: 'Vue调试工具', path: 'vue/vue入门/Vue调试工具.md' },
          ]
        },
        {
          name: '指令',
          pages: [
            { name: '指令的介绍', path: 'vue/指令/指令的介绍.md' },
            { name: '文本类指令', path: 'vue/指令/文本类指令.md' },
            { name: 'v-for', path: 'vue/指令/v-for.md' },
            { name: '作业', path: 'vue/指令/作业.md' },
            { name: '条件类指令', day: 2, path: 'vue/指令/条件类指令.md' },
            { name: 'v-for和v-if的优先级', day: 2, path: 'vue/指令/v-for和v-if的优先级.md' },
            { name: '属性绑定', path: 'vue/指令/属性绑定.md' },
            { name: '事件绑定', path: 'vue/指令/事件绑定.md' },
            { name: 'v-model', path: 'vue/指令/v-model.md' },
            { name: 'v-once', path: 'vue/指令/v-once.md' },
            { name: 'v-cloak', path: 'vue/指令/v-cloak.md' },
          ]
        },
        {
          name: '生命周期',
          pages: [
            { name: '生命周期', day: 3, path: 'vue/生命周期/生命周期.md' },
          ]
        },
        {
          name: '方法',
          pages: [
            { name: 'methods', path: 'vue/方法/方法.md' },
          ]
        },
        {
          name: '响应式',
          pages: [
            { name: '计算属性', path: 'vue/响应式/computed.md' },
            { name: 'computed和methods的区别', path: 'vue/响应式/computed和methods的区别.md' },
            { name: '侦听器', path: 'vue/响应式/watch.md' },
            { name: '作业', path: 'vue/响应式/作业.md' },
          ]
        },
        {
          name: '自定义组件',
          pages: [
            { name: '组件的概念', day: 4, path: 'vue/自定义组件/组件的概念.md' },
            { name: '自定义组件', path: 'vue/自定义组件/自定义组件.md' },
            { name: '组件之间的通信方式', path: 'vue/自定义组件/组件之间的通信方式.md' },
            { name: '父组件传值给子组件', path: 'vue/自定义组件/父组件传值给子组件.md' },
            { name: '父组件监听子组件的事件', path: 'vue/自定义组件/父组件监听子组件的事件.md' },
            { name: '组件间的其他通信', path: 'vue/自定义组件/组件通信.md' },
            { name: '作业', path: 'vue/自定义组件/作业.md' },
            { name: '组件插槽vue3', path: 'vue/自定义组件/组件插槽vue3.md' },
            { name: '组件插槽vue2', day: 5, path: 'vue/自定义组件/组件插槽vue2.md' },
            { name: '自定义组件双向绑定Vue2', path: 'vue/自定义组件/自定义组件双向绑定Vue2.md' },
            { name: '自定义组件双向绑定', path: 'vue/自定义组件/自定义组件双向绑定.md' },
            { name: '作业', path: 'vue/自定义组件/作业1.md' },
            { name: '自定义组件多个v-model的绑定', path: 'vue/自定义组件/自定义组件多个v-model的绑定.md' },
            { name: '父子组件生命周期的顺序期的顺序', path: 'vue/自定义组件/父子组件生命周期的顺序.md' },
          ]
        },
        {
          name: '其他要点',
          pages: [
            { name: '$nextTick', path: 'vue/其他重要点/$nextTick.md' },
            { name: '强制刷新', path: 'vue/其他重要点/强制刷新.md' },
            { name: 'Teleport传送门', path: 'vue/其他重要点/Teleport传送门.md' },
            { name: '异步组件', path: 'vue/其他重要点/异步组件.md' },
            { name: '过渡效果', path: 'vue/其他重要点/过渡效果.md' },
            { name: '自定义指令', path: 'vue/指令/自定义指令.md' },
            { name: '过滤器', path: 'vue/其他重要点/过滤器.md' },
            { name: 'moment', path: 'share/时间和数据处理/dayjs.md' },
            { name: 'lodash', path: 'share/时间和数据处理/lodash.md' },
            { name: '安装sass的问题', path: 'vue/其他重要点/安装sass的问题.md' },
            { name: '作业', path: 'vue/自定义组件/作业2.md' },
            { name: '周末作业', path: 'share/时间和数据处理/作业.md' },
          ]
        },
        {
          name: '脚手架',
          pages: [
            { name: '常用的脚手架', day: 6, path: 'vue/脚手架/常用的脚手架.md' },
            { name: 'VueCli', path: 'vue/脚手架/VueCli.md' },
            { name: '单文件组件', path: 'vue/脚手架/单文件组件选项式API.md' },
          ]
        },
        {
          name: '路由',
          pages: [
            { name: '路由的简介', path: 'vue/router/路由的简介.md' },
            { name: 'Vue Router', path: 'vue/router/vue-router-cli.md' },
            { name: '作业', path: 'vue/router/作业.md' },
            { name: '路由传参', path: 'vue/router/路由传参.md' },
            { name: '编程式导航', path: 'vue/router/编程式导航.md' },
            { name: '嵌套路由', path: 'vue/router/嵌套路由.md' },
            { name: '路由守卫', path: 'vue/router/路由守卫.md' },
            { name: 'keep-alive', path: 'vue/router/keep-alive.md' },
            // { name: '监听路由', day: 7, path: 'vue/router/监听路由.md' },
            { name: 'router更多的知识', path: 'vue/router/router更多的知识.md' },
          ]
        },
        {
          name: '全局状态控制',
          pages: [
            { name: '全局状态控制', path: 'vue/全局状态控制/状态管理.md' },
            { name: '依赖注入', path: 'vue/全局状态控制/依赖注入.md' },
            { name: 'vuex', path: 'vue/全局状态控制/vuex.md' },
            { name: 'mergeProps', path: 'vue/其他重要点/mergeProps.md' },
          ]
        },
        {
          name: '版本管理',
          pages: [
            { name: '版本管理介绍', day: 8, path: 'share/git/版本管理介绍.md' },
            { name: 'git的安装', path: 'share/git/git的安装.md' },
            { name: 'git的常用命令', path: 'share/git/git的常用命令.md' },
            { name: 'git文件提交训练', path: 'share/git/git文件提交训练.md' },
            { name: 'git的缩写', path: 'share/git/git的缩写.md' },
            { name: 'git的远程同步命令', path: 'share/git/git的远程同步命令.md' },
            { name: 'git解决冲突', path: 'share/git/git解决冲突.md' },
            { name: 'git的分支与版本', path: 'share/git/git的分支与版本.md' },
            { name: 'gitflow', path: 'share/git/gitflow.md' },
            { name: 'gitflow发布流程', path: 'share/git/gitflow发布流程.md' },
            { name: 'git的忽略文件', path: 'share/git/git的忽略文件.md' },
            { name: 'vscode中git的使用', path: 'share/git/vscode中git的使用.md' },
            { name: '搭建远程服务', path: 'share/git/搭建远程服务.md' },
            { name: '清除历史版本', path: 'share/git/清除历史版本.md' },
          ]
        },
        {
          name: '移动端项目',
          pages: [
            { name: '工程简介', day: 9, path: 'vue/移动端项目/工程简介.md' },
            { name: '搭建工程', path: 'vue/移动端项目/搭建工程.md' },
            { name: '引入vant组件库', path: 'vue/移动端项目/引入vant组件库.md' },
            { name: '添加登录页面', path: 'vue/移动端项目/登录页面.md' },
            { name: '搭建路由', path: 'vue/移动端项目/搭建路由.md' },
            { name: '商品列表界面', path: 'vue/移动端项目/商品列表界面.md' },
            { name: '调整字体大小的适配', path: 'vue/移动端项目/调整字体大小的适配.md' },
            { name: '接口文档', path: 'vue/移动端项目/接口文档.md' },
            { name: '使用axios访问列表数据', path: 'vue/移动端项目/使用axios访问列表数据.md' },
            { name: '作业', path: 'vue/移动端项目/作业.md' },
            { name: '路由跳转到商品详情页面', path: 'vue/移动端项目/路由跳转到商品详情页面.md' },
            { name: '商品详情界面', path: 'vue/移动端项目/商品详情界面.md' },
            { name: '网络接口的封装', day: 10, path: 'vue/移动端项目/网络接口的封装.md' },
            { name: '将post添加为全局变量', path: 'vue/移动端项目/将post添加为全局变量.md' },
            { name: '对商品列表页面keepAlive', path: 'vue/移动端项目/对商品列表页面keepAlive.md' },
            { name: '加入商品到购物车', path: 'vue/移动端项目/加入商品到购物车.md' },
            { name: '添加中央消息总线', path: 'vue/移动端项目/添加中央消息总线.md' },
            { name: '购物车列表界面', path: 'vue/移动端项目/购物车列表界面.md' },
            { name: '选择自提点界面', path: 'vue/移动端项目/选择自提点界面.md' },
            { name: '添加提交订单', path: 'vue/移动端项目/添加提交订单.md' },
            { name: '添加待取货物列表', path: 'vue/移动端项目/添加待取货物列表.md' },
            { name: '添加直接购买页面', path: 'vue/移动端项目/添加直接购买页面.md' },
            { name: '封装便利传参的路由函数', path: 'vue/移动端项目/封装便利传参的路由函数.md' },
            { name: '添加个人中心', day: 11, path: 'vue/移动端项目/添加个人中心.md' },
            { name: '添加已完成订单列表', path: 'vue/移动端项目/添加已完成订单列表.md' },
            { name: '添加注册页面', path: 'vue/移动端项目/注册页面.md' },
            { name: '忘记密码页面', path: 'vue/移动端项目/忘记密码页面.md' },
            { name: '修改密码页面', path: 'vue/移动端项目/修改密码页面.md' },
            { name: '周末作业', path: 'vue/移动端项目/周末作业.md' },
            { name: '登录后个人信息保存', path: 'vue/移动端项目/登录后个人信息保存.md' },
            { name: '永久登录设置', path: 'vue/移动端项目/永久登录设置.md' },
            { name: '添加个人信息页面', day: 12, path: 'vue/移动端项目/添加个人信息页面.md' },
            // { name: '添加订单投诉界面', path: 'vue/移动端项目/添加订单投诉界面.md' },
            // { name: '添加对商品的评论', path: 'vue/移动端项目/添加对商品的评论.md' },
            // { name: '优化各个界面', path: 'vue/移动端项目/优化各个界面.md' },
            { name: '打包发布', path: 'vue/移动端项目/打包发布.md' },
          ]
        },
        {
          name: '脚手架',
          pages: [
            { name: 'CreateVue', day: 13, path: 'vue/脚手架/CreateVue.md' },
            { name: '单文件组件', path: 'vue/脚手架/单文件组件.md' },
            { name: 'h函数', path: 'vue/其他重要点/h函数.md' },
            { name: '递归组件', path: 'vue/脚手架/递归组件.md' },
            { name: 'mixins', path: 'vue/自定义组件/mixins.md' },
            { name: '全局变量', path: 'vue/其他重要点/全局变量.md' },
            { name: '插件', path: 'vue/自定义组件/插件.md' },
          ]
        },
        {
          name: '组合式API',
          pages: [
            { name: '基本概念', path: 'vue/组合式API/基本概念.md' },
            { name: 'vue2和vue3响应式区别', path: 'vue/组合式API/vue2和vue3响应式区别.md' },
            { name: 'setup函数', path: 'vue/组合式API/setup函数.md' },
            { name: 'script setup', path: 'vue/脚手架/script_setup.md' },
            { name: '响应式变量', path: 'vue/组合式API/响应式变量.md' },
            { name: '子组件的引用', path: 'vue/组合式API/子组件的引用.md' },
            { name: '计算属性', path: 'vue/组合式API/计算属性.md' },
            { name: '侦听器', path: 'vue/组合式API/侦听器.md' },
            { name: '生命周期钩子', path: 'vue/组合式API/生命周期钩子.md' },
            { name: '依赖注入', path: 'vue/组合式API/依赖注入.md' },
          ]
        },
        {
          name: '组合式API路由',
          pages: [
            { name: '组合式API路由', path: 'vue/router/vue-router.md' },
            { name: '组合式API编程式导航', path: 'vue/router/组合式API编程式导航.md' },
          ]
        },
        {
          name: '全局状态控制',
          pages: [
            { name: 'pinia', day: 14, path: 'vue/全局状态控制/pinia.md' },
            { name: 'createVue自动添加pinia', path: 'vue/全局状态控制/createVue自动添加pinia.md' },
          ]
        },
        {
          name: '后台管理项目',
          pages: [
            { name: 'api', path: 'vue/后台管理项目/api.md' },
            { name: '采用cdn搭建工程', path: 'vue/后台管理项目/采用cdn搭建工程.md' },
            { name: '导出element-plus全局的方法', path: 'vue/后台管理项目/导出element-plus全局的方法.md' },
            { name: 'cdn引入element-plus汉语包', path: 'vue/后台管理项目/cdn引入element-plus汉语包.md' },
            { name: '定义常量', path: 'vue/后台管理项目/定义常量.md' },
            { name: '定义utils库', path: 'vue/后台管理项目/定义utils库.md' },
            { name: '对axios接口进行封装', path: 'vue/后台管理项目/对axios接口进行封装.md' },
            { name: '封装api', path: 'vue/后台管理项目/封装api.md' },
            { name: '提供一些必须的库', path: 'vue/后台管理项目/提供一些必须的库.md' },
            { name: '引入ui框架', path: 'vue/后台管理项目/引入ui框架.md' },
            { name: '搭建路由', path: 'vue/后台管理项目/搭建路由.md' },
            { name: '搭建首页菜单', path: 'vue/后台管理项目/搭建首页菜单.md' },
            { name: '标准增删改查', path: 'vue/后台管理项目/标准增删改查.md' },
            { name: '添加人员列表页面', path: 'vue/后台管理项目/添加人员列表页面.md' },
            { name: '添加人员详情页面', path: 'vue/后台管理项目/添加人员详情页面.md' },
            { name: '添加登录页面', path: 'vue/后台管理项目/添加登录页面.md' },
            { name: '添加form表单的验证', path: 'vue/后台管理项目/添加form表单的验证.md' },
            { name: '封装form的文本组件', path: 'vue/后台管理项目/封装form的文本组件.md' },
            { name: '封装form的图片组件', path: 'vue/后台管理项目/封装form的图片组件.md' },
            { name: '导入导出excel', path: 'vue/后台管理项目/导入导出excel.md' },
            { name: '搭建mongodb的服务接口', path: 'vue/后台管理项目/搭建mongodb的服务接口.md' },
            { name: '百度地图', path: 'vue/后台管理项目/百度地图.md' },
            { name: '统计图', path: 'vue/后台管理项目/统计图.md' },
            { name: '打包发布', path: 'vue/移动端项目/打包发布.md' },
          ]
        },
      ],
    },
    {
      visible: true,
      name: 'react',
      groups: [
        {
          name: 'react初探',
          pages: [
            { name: 'react简介', day: 0, path: 'react/react初探/react简介.md' },
          ]
        },
        {
          name: 'react入门',
          pages: [
            { name: 'helloworld', path: 'react/react入门/helloworld.md' },
            { name: 'JSX语法', path: 'react/react入门/jsx.md' },
          ]
        },
        {
          name: '脚手架',
          pages: [
            { name: 'create-react-app', path: 'react/脚手架/create-react-app.md' },
            { name: 'vite', path: 'react/脚手架/vite.md' },
          ]
        },
        {
          name: '组件',
          pages: [
            { name: '组件分类', path: 'react/组件/组件分类.md' },
            { name: '状态', path: 'react/组件/状态.md' },
            { name: '属性', path: 'react/组件/属性.md' },
            { name: '事件绑定', path: 'react/组件/事件绑定.md' },
            { name: '受控组件', path: 'react/组件/受控组件.md' },
            { name: '生命周期', path: 'react/组件/生命周期.md' },
            { name: '旧版本生命周期', path: 'react/组件/旧版本生命周期.md' },
            { name: '引用', path: 'react/组件/引用.md' },
            { name: '上下文', path: 'react/组件/上下文.md' },
          ]
        },
        {
          name: '高阶组件',
          pages: [
            { name: '高阶组件', day: 2, path: 'react/高阶组件/高阶组件.md' },
          ]
        },
        {
          name: '其他知识点',
          pages: [
            { name: '传送门createPortal', day: 2, path: 'react/其他知识点/传送门createPortal.md' },
            { name: '扩展符的使用', day: 2, path: 'react/其他知识点/扩展符的使用.md' },
            { name: 'css模块化', day: 2, path: 'react/其他知识点/css模块化.md' },
            { name: '添加全局路径', day: 2, path: 'react/其他知识点/添加全局路径.md' },
          ]
        },
        {
          name: '路由V5',
          pages: [
            { name: 'react-router-dom@5', path: 'react/router@5/react-router-dom.md' },
            { name: '嵌套路由', path: 'react/router@5/嵌套路由.md' },
            { name: '路由的渲染方式', path: 'react/router@5/路由的渲染方式.md' },
            { name: '编程式导航', path: 'react/router@5/编程式导航.md' },
            { name: '路由传参', path: 'react/router@5/路由传参.md' },
          ]
        },
        {
          name: 'react-native',
          pages: [
            { name: '注册账号', path: 'react-native/注册账号.md' },
            { name: 'helloworld', path: 'react-native/helloworld.md' },
            { name: '添加全局路径缩写', path: 'react-native/添加全局路径缩写.md' },
            { name: 'expo搭建工程', path: 'react-native/expo搭建工程.md' },
            { name: 'ant-design-mobile-rn', path: 'react-native/ant-design-mobile-rn.md' },
            { name: '使用fetch封装网络接口', path: 'react-native/使用fetch封装网络接口.md' },
            { name: 'TextInput的用法', path: 'react-native/TextInput的用法.md' },
            { name: 'Router', path: 'react-native/Router.md' },
            { name: '真机打包', path: 'react-native/真机打包.md' },
          ]
        },
        {
          name: 'hooks',
          pages: [
            { name: 'hooks的概念', day: 7, path: 'react/hooks/hooks.md' },
            { name: 'useState', path: 'react/hooks/useState.md' },
            { name: 'useEffect', path: 'react/hooks/useEffect.md' },
            { name: 'useContext', path: 'react/hooks/useContext.md' },
            { name: 'useRef', path: 'react/hooks/useRef.md' },
            { name: 'useMemo', path: 'react/hooks/useMemo.md' },
            { name: 'useCallback', path: 'react/hooks/useCallback.md' },
            { name: '自定义hooks', path: 'react/hooks/自定义hooks.md' },
          ]
        },
        {
          name: '路由V6',
          pages: [
            { name: 'react-router-dom', day: 8, path: 'react/router/react-router-dom.md' },
            { name: '嵌套路由', path: 'react/router/嵌套路由.md' },
            { name: '路由传参', path: 'react/router/函数式路由传参.md' },
            { name: '编程式导航', path: 'react/router/函数式编程式导航.md' },
            { name: '类组件中router6的编程式导航', path: 'react/router/类组件中router6的编程式导航.md' },
            { name: '异步加载', path: 'react/router/异步加载.md' },
          ]
        },
        {
          name: '全局状态管理',
          pages: [
            { name: 'flux', day: 9, path: 'react/redux/flux.md' },
            { name: 'redux', path: 'react/redux/redux.md' },
            { name: 'react-redux', path: 'react/redux/react-redux.md' },
            { name: 'redux-thunk', path: 'react/redux/redux-thunk.md' },
            { name: 'redux-toolkit', path: 'react/redux/redux-toolkit.md' },
            { name: 'redux分模块使用', path: 'react/redux/redux分模块使用.md' },
          ]
        },
        {
          name: '后台管理项目',
          pages: [
            { name: '首页菜单', path: 'react/后台管理项目/首页菜单.md' },
            { name: '增删改查页面', path: 'react/后台管理项目/增删改查页面.md' },
            { name: '树形结构', path: 'react/后台管理项目/树形结构.md' },
            { name: '封装组件', path: 'react/后台管理项目/封装组件.md' },
            { name: '登录页面', path: 'react/后台管理项目/登录页面.md' },
            { name: '登录权鉴', path: 'react/后台管理项目/登录权鉴.md' },
            { name: '添加路径别名', path: 'react/后台管理项目/添加路径别名.md' },
            { name: '跨域设置', path: 'react/后台管理项目/跨域设置.md' },
            { name: 'excel导入导出', path: 'react/后台管理项目/excel导入导出.md' },
            { name: '富文本使用', path: 'react/后台管理项目/富文本使用.md' },
            { name: '打包发布', path: 'react/后台管理项目/打包发布.md' },
          ]
        },
      ]
    },
    {
      visible: true,
      name: '编程基础',
      groups: [
        {
          name: 'emmet',
          pages: [
            { name: 'emmet', path: 'share/emmet/emmet.md' },
          ]
        },
        {
          name: 'fabric.js的使用',
          pages: [
            { name: '简介', path: 'share/fabric.js/简介.md' },
            { name: '绘制图片', path: 'share/fabric.js/绘制图片.md' },
            { name: '绘制基础图形', path: 'share/fabric.js/绘制基础图形.md' },
            { name: '图层操作', path: 'share/fabric.js/图层操作.md' },
            { name: '常用api', path: 'share/fabric.js/常用api.md' },
            { name: '事件', path: 'share/fabric.js/事件.md' },
            { name: '拖动画板', path: 'share/fabric.js/拖动画板.md' },
            { name: '画板涂鸦', path: 'share/fabric.js/画板涂鸦.md' },
            { name: '分组', path: 'share/fabric.js/分组.md' },
            { name: '动画', path: 'share/fabric.js/动画.md' },
            { name: '图像滤镜', path: 'share/fabric.js/图像滤镜.md' },
            { name: '渐变', path: 'share/fabric.js/渐变.md' },
            { name: '右键菜单', path: 'share/fabric.js/右键菜单.md' },
          ]
        },
        {
          name: 'leafer-ui',
          pages: [
            { name: '简介', path: 'share/leafer-ui/简介.md' },
          ]
        },
        {
          name: 'webrtc',
          pages: [
            { name: '摄像头', path: 'share/webrtc/摄像头.md' },
            { name: '拍照', path: 'share/webrtc/拍照.md' },
            { name: '录像', path: 'share/webrtc/录像.md' },
          ]
        },
        {
          name: 'mock',
          pages: [
            { name: '基本用法', path: 'share/mock/基本用法.md' },
            { name: '基础语法', path: 'share/mock/基础语法.md' },
          ]
        },
        {
          name: 'mongodb',
          pages: [
            { name: '基础', path: 'share/mongo/基础.md' },
            { name: '角色', path: 'share/mongo/角色.md' },
            { name: '配置', path: 'share/mongo/配置.md' },
            { name: '主从集群', path: 'share/mongo/主从集群.md' },
            { name: '审计日志', path: 'share/mongo/审计日志.md' },
          ]
        },
        {
          name: '网络请求',
          pages: [
            { name: '网络协议的介绍', path: 'share/网络请求/网络协议的介绍.md' },
            { name: 'axios的基础使用', path: 'share/网络请求/axios的基础使用.md' },
            { name: 'api接口的封装', path: 'share/网络请求/api接口的封装.md' },
            { name: 'socketio的使用', path: 'share/网络请求/socketio的使用.md' },
            { name: '搭建一个聊天室', path: 'share/网络请求/搭建一个聊天室.md' },
          ]
        },
        {
          name: 'typescript',
          pages: [
            { name: 'TypeScript简介', path: 'share/typescript/TypeScript简介.md' },
            { name: '类型', path: 'share/typescript/类型.md' },
            { name: '泛型', path: 'share/typescript/泛型.md' },
          ]
        },
        {
          name: '时间和数据处理',
          pages: [
            { name: 'moment', path: 'share/时间和数据处理/dayjs.md' },
            { name: 'lodash', path: 'share/时间和数据处理/lodash.md' },
          ]
        },
        {
          name: '面试相关',
          pages: [
            { name: '简历的编写', path: 'share/面试/简历的编写.md' },
            { name: '面试题', path: 'share/面试/面试题.md' },
            { name: 'js', path: 'share/面试/js.md' },
            { name: 'html', path: 'share/面试/html.md' },
            { name: 'css', path: 'share/面试/css.md' },
            { name: 'net', path: 'share/面试/net.md' },
            { name: 'git', path: 'share/面试/git.md' },
            { name: 'vue', path: 'share/面试/vue.md' },
            { name: 'react', path: 'share/面试/react.md' },
            { name: '微信小程序', path: 'share/面试/微信小程序.md' },
          ]
        },
        {
          name: 'umi',
          pages: [
            { name: '搭建工程', path: 'share/umi/搭建工程.md' },
            { name: '使用layout搭建界面', path: 'share/umi/使用layout搭建界面.md' },
            { name: '使用路由搭建界面', path: 'share/umi/使用路由搭建界面.md' },
          ]
        },
        {
          name: '大屏',
          pages: [
            { name: 'datav', path: 'share/datav/安装.md' },
            { name: '大屏设计器', path: 'share/低代码/大屏设计器.md' },
          ]
        },
        {
          name: '比较工具',
          pages: [
            { name: 'diffmerge', path: 'share/比较工具/diffmerge.md' },
          ]
        },
        {
          name: '教学相关',
          pages: [
            { name: '教学大纲', path: 'http://wap.qfedu.com/dg/h5-jy.html' },
          ]
        },
        {
          name: '其他',
          pages: [
            { name: '表单设计器', path: 'share/低代码/表单设计器.md' },
            { name: 'petite-vue', path: 'share/petite-vue/petite-vue.md' },
          ]
        },
      ]
    },
    {
      visible: true,
      name: '微信小程序',
      groups: [
        {
          name: '原生小程序',
          pages: [
            { name: '安装微信开发者工具', path: 'weixin/环境搭建/安装微信开发者工具.md' },
            { name: '账号申请', path: 'weixin/环境搭建/账号申请.md' },
            { name: 'helloworld', path: 'weixin/环境搭建/helloworld.md' },
          ]
        },
        {
          name: '总体介绍',
          pages: [
            { name: 'App', path: 'weixin/总体介绍/App.md' },
            { name: 'Page', path: 'weixin/总体介绍/Page.md' },
          ]
        },
        {
          name: '语法介绍',
          pages: [
            { name: '数据绑定', path: 'weixin/语法介绍/数据绑定.md' },
            { name: '列表渲染', path: 'weixin/语法介绍/列表渲染.md' },
            { name: '条件渲染', path: 'weixin/语法介绍/条件渲染.md' },
            { name: '模板', path: 'weixin/语法介绍/模板.md' },
            { name: '点击事件', path: 'weixin/语法介绍/点击事件.md' },
          ]
        },
        {
          name: '更多介绍',
          pages: [
            { name: 'Router', path: 'weixin/总体介绍/Router.md' },
            { name: 'NetWork', path: 'weixin/总体介绍/NetWork.md' },
            { name: 'Component', path: 'weixin/总体介绍/Component.md' },
          ]
        },
        {
          name: '功能展示',
          pages: [
            { name: '地图', path: 'weixin/案例/地图.md' },
            { name: '登录页面', path: 'weixin/案例/登录页面.md' },
            { name: '定位', path: 'weixin/案例/定位.md' },
            { name: '获取手机号码', path: 'weixin/案例/获取手机号码.md' },
            { name: '微信授权登录', path: 'weixin/案例/微信授权登录.md' },
            { name: '微信支付', path: 'weixin/案例/微信支付.md' },
            { name: '相机操作', path: 'weixin/案例/相机操作.md' },
          ]
        },
        {
          name: 'taro',
          pages: [
            { name: '搭建工程', path: 'weixin/taro/搭建工程.md' },
            { name: '底部菜单配置', path: 'weixin/taro/底部菜单配置.md' },
            { name: '路由传参', path: 'weixin/taro/路由传参.md' },
            { name: '页面之间的事件', path: 'weixin/taro/页面之间的事件.md' },
            { name: '中央消息中心', path: 'weixin/taro/中央消息中心.md' },
            { name: '设置全局变量', path: 'weixin/taro/设置全局变量.md' },
            { name: 'webpack5编译错误', path: 'weixin/taro/webpack5编译错误.md' },
          ]
        },
        {
          name: 'uni-app',
          pages: [
            { name: '安装HBuilderX', path: 'weixin/uni-app/环境搭建/安装HBuilderX.md' },
            { name: '透明导航栏', path: 'weixin/uni-app/环境搭建/透明导航栏.md' },
            { name: '创建项目', path: 'weixin/uni-app/商城App/创建项目.md' },
            { name: '底部菜单', path: 'weixin/uni-app/商城App/底部菜单.md' },
            { name: '电影列表', path: 'weixin/uni-app/商城App/电影列表.md' },
            { name: '添加vant', path: 'weixin/uni-app/商城App/添加vant.md' },
            { name: '封装网络接口', path: 'weixin/uni-app/商城App/封装网络接口.md' },
            { name: '获取openid', path: 'weixin/uni-app/商城App/获取openid.md' },
            { name: '账号绑定页面', path: 'weixin/uni-app/商城App/账号绑定页面.md' },
            { name: '添加模拟支付', path: 'weixin/uni-app/商城App/添加模拟支付.md' },
            { name: '分享', path: 'weixin/uni-app/商城App/分享.md' },
            { name: '相机', path: 'weixin/uni-app/商城App/相机.md' },
            { name: '定位', path: 'weixin/uni-app/商城App/定位.md' },
            { name: 'web-view', path: 'weixin/uni-app/商城App/web-view.md' },
            { name: 'uni-app常用知识点', path: 'weixin/uni-app/商城App/uni-app常用知识点.md' },
          ]
        },
      ]
    },
    {
      visible: true,
      name: 'linux',
      groups: [
        {
          name: 'centos',
          pages: [
            { name: 'docker', path: 'linux/centos/docker.md' },
            { name: 'redis', path: 'linux/centos/redis.md' },
            { name: 'ssh免密登录', path: 'linux/centos/ssh免密登录.md' },
            { name: '宝塔', path: 'linux/centos/宝塔.md' },
            { name: '开启对外端口', path: 'linux/centos/开启对外端口.md' },
            { name: '网络', path: 'linux/centos/网络.md' },
            { name: '虚拟机', path: 'linux/centos/虚拟机.md' },
            { name: '远程调试php', path: 'linux/centos/远程调试php.md' },
            { name: '逍遥模拟器', path: 'linux/centos/逍遥模拟器.md' },
            { name: 'uni-app离线打包', path: 'linux/uni-app/uni-app离线打包.md' },
          ]
        },
        {
          name: '微信支付',
          pages: [
            {
              name: '第一步',
              path: 'linux/微信支付/01.png',
            },
            {
              name: '第二步',
              path: 'linux/微信支付/02.png',
            },
            {
              name: '第三步',
              path: 'linux/微信支付/03.png',
            },
            {
              name: '第四步',
              path: 'linux/微信支付/04.png',
            },
            {
              name: '第五步',
              path: 'linux/微信支付/05.png',
            },
            {
              name: '第六步',
              path: 'linux/微信支付/08.png',
            },
            {
              name: '第七步',
              path: 'linux/微信支付/09.png',
            },
          ],
        },
      ]
    },
  ]
};

function getPlan(subMenus) {
  const list = [];
  subMenus.forEach((o, k) => {
    list.push(`### 第${k + 1}天`);
    o.groups.forEach(g => {
      list.push(`- ${g.name}`);
      g.pages.forEach(p => {
        list.push(`  - ${p.name}`);
      });
    });
  });
  return list.join('\n');
}

config.menus = config.menus.filter(m => m.visible !== false);
// 划分天数
if (config.days) {
  config.menus = config.menus.map((m, i) => {
    let day = 1;
    let subMenus = [];
    let groups = [];
    let pages = [];
    for (const group of m.groups) {
      for (const page of group.pages) {
        if (!page.day) {
          pages.push(page);
        } else {
          pages.length && groups.push({ name: group.name, pages });
          subMenus.push({ name: 'day' + _.padStart(day, 2, 0), groups });
          groups = [];
          pages = [page];
          day = page.day;
        }
      }
      pages.length && groups.push({ name: group.name, pages });
      pages = [];
    }
    groups.length && subMenus.push({ name: 'day' + _.padStart(day, 2, 0), groups });
    return {
      name: m.name,
      subMenus,
    };
  });
  config.menus = config.menus.map((m, i) => ({
    name: m.name,
    subMenus: m.subMenus.filter((o, k) => !config.days[i] || config.days[i].includes(k + 1)),
  })).filter(o => o.subMenus.length);
  config.menus.forEach(o => {
    o.subMenus[0].groups.unshift({ name: '教学计划', pages: [{ name: '教学计划', content: getPlan(o.subMenus) }] })
  });
} else if (config.day ) {
  config.menus = config.menus.map((m, i) => {
    let groups = [];
    let pages = [];
    outer:for (const group of m.groups) {
      for (const page of group.pages) {
        if (config.day < page.day) {
          pages.length && groups.push({ name: group.name, pages });
          break outer;
        }
        pages.push(page);
      }
      pages.length && groups.push({ name: group.name, pages });
      pages = [];
    }
    return {
      name: m.name,
      groups,
    };
  });
}
module.exports = config;
